package com.mcxx.modules.temporary.family.dao.write;

import org.apache.ibatis.annotations.Mapper;
import com.mcxx.modules.temporary.family.entity.TmpFamilyMemberEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TmpFamilyMemberWriteDao {

	int insert(TmpFamilyMemberEntity tmpFamilyMember);


	int insertIgnoreNull(TmpFamilyMemberEntity tmpFamilyMember);


	int update(TmpFamilyMemberEntity tmpFamilyMember);


	int updateIgnoreNull(TmpFamilyMemberEntity tmpFamilyMember);


	int delete(TmpFamilyMemberEntity tmpFamilyMember);


	int updateFamilyRelation(String familyId, String idcard);


    int copyFromOtherSource(@Param("familyId") String familyId,@Param("newFamilyId") String newFamilyId);


	int copyFromSplittingSource(@Param("familyId") String familyId,@Param("newFamilyId") String newFamilyId,@Param("memberState") String memberState);


	int updateByIdCard(TmpFamilyMemberEntity tmpMemberEntity);


    int updateAreaCodeByFamilyId(@Param("areaCode") String areaCode, @Param("familyId") String familyId);


	int updateIsSaveByFamilyId( @Param("familyId") String familyId);

    int updateMemberIsApply(@Param("familyId") String familyId,@Param("idcard") String idcard);

	int changApplyMember(@Param("familyId")String familyId,@Param("memberId")String memberId);

	int copyFromLowerSource(@Param("familyId") String familyId,@Param("newFamilyId") String newFamilyId);


	int copyFromLowerSplitSource(@Param("familyId") String familyId,@Param("newFamilyId") String newFamilyId,@Param("memberState") String memberState);


    int deleteMemberByIdCards(@Param("idCards") List<String> idCards);


	void updateTempFamilyInfo(@Param("idCards") List<String> familyIds);

    int deleteFamilyMemberByIdCardAndNoHasFamilyId(String idCard, String familyId);

	int deleteFamilyMemberByIdCard(String idCard);
}
